home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample PMSAM / PMSAM Framework / RoboSamSlot / IncomingHFSStream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  1.5 KB  |  84 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        IncomingHFSStream.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by:    David Akhond
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.  
  13.     To Do:  
  14.     
  15.     
  16. */
  17.  
  18.  
  19.  
  20. #ifndef __IncomingHFSStream__
  21. #define __IncomingHFSStream__
  22.  
  23.  
  24. #ifndef     __FileUtils__
  25. #include    "FileUtils.h"
  26. #endif
  27.  
  28. #ifndef __STRINGS__
  29. #include "Strings.h"
  30. #endif
  31.  
  32. enum LetterPos {    eNone, eFromRecips, eToRecips, eCCRecips, eBccRecips, eBody  };
  33.  
  34. const OSType        kLetterType    = 'TEXT';
  35. const OSType        kLetterCreator = 'ttxt';
  36. const long            kMaxLineLen = 512;
  37.  
  38. class    CIncomingHFSStream {
  39.  
  40. public:
  41.  
  42.                                 CIncomingHFSStream(CFile*            theLetterFile);
  43.                                 ~CIncomingHFSStream();
  44.  
  45.             void                FromRecipient(char*    author);
  46.             
  47.             Boolean                NextToRecipient(char*    nextToRecipient);
  48.             Boolean                NextCCRecipient(char*    nextCCRecipient);
  49.             Boolean                NextBCCRecipient(char*    nextBCCRecipient);
  50.                         
  51.             Boolean                BodyText( char*    textBuff, long*    count );  // on entry, count is the size of textBuff; on exit, the count of chars returned in textBuff. return value is true if this is the last buffer of text in the file
  52.             
  53.             void                FromField();        // get the From: field for processing
  54.             void                ToField();
  55.             void                CCField();
  56.             void                BCCField();
  57.             void                BodyField();
  58.             
  59.             char                fFromRecipient[64];
  60.  
  61. private:
  62.  
  63.  
  64.             CFile*                fLetterFile;
  65.                         
  66.             long                fStreamPos;
  67.             
  68.             char                fTempRecipient[64];
  69.             
  70.             char                 fLineBuf[kMaxLineLen];
  71.             long                fLineBufLen;
  72.             long                fLineBufPos;
  73.  
  74.             short                fLetterPos;
  75.  
  76. };
  77.  
  78.  
  79.  
  80.  
  81. #endif
  82.  
  83.  
  84.